// 文件导出
const downloadFile = (data, name) => {
  if (!data) {
    return
  }
  const url = window.URL.createObjectURL(new Blob([data]))
  const link = document.createElement('a')
  link.style.display = 'none'
  link.href = url
  link.setAttribute('download', `${name}.xls`)

  document.body.appendChild(link)
  link.click()
}

// // 树形数据
// const arrayToTree = (arr) => {
//   const tree = []
//   arr.forEach(i => {
//     if(tree.indexOf(i.name))
//   })
// }
export default {
  downloadFile
}
